use serde::{Deserialize, Serialize};
use chrono::{DateTime, Utc};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LogEntry {
    pub id: Option<i64>,
    pub timestamp: DateTime<Utc>,
    pub level: String,
    pub source: String,
    pub message: String,
    pub file_path: String,
    pub line_number: Option<i32>,
    pub raw_content: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AnalysisCase {
    pub id: Option<i64>,
    pub name: String,
    pub description: String,
    pub category: String,
    pub patterns: Vec<String>,
    pub ai_prompts: Vec<String>,
    pub tags: Vec<String>,
    pub created_at: DateTime<Utc>,
    pub updated_at: DateTime<Utc>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AnalysisResult {
    pub id: Option<i64>,
    pub case_id: i64,
    pub log_entries: Vec<LogEntry>,
    pub severity: String,
    pub title: String,
    pub summary: String,
    pub cause: String,
    pub impact: String,
    pub suggestions: Vec<String>,
    pub created_at: DateTime<Utc>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ImportOptions {
    pub encoding: String,
    pub format: String,
    pub time_format: String,
    pub auto_parse: bool,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LogFile {
    pub id: Option<i64>,
    pub name: String,
    pub path: String,
    pub size: u64,
    pub imported_at: DateTime<Utc>,
    pub entry_count: i64,
} 